package com.yike.product.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yike.common.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import com.yike.common.api.Update;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 商品表
 *
 * @author yike
 * @since 2024-07-17
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@TableName("qy_goods")
@ApiModel(value = "Goods对象")
@ToString(callSuper = true)
public class Goods extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("店铺ID")
    private Long shopId;

    @NotBlank(message = "商品条码不能为空")
    @ApiModelProperty("商品条码")
    private String barcode;

    @NotBlank(message = "商品名称不能为空")
    @ApiModelProperty("商品名称")
    private String name;

    @ApiModelProperty("商品图片")
    private String image;

    @ApiModelProperty("商品售价")
    private BigDecimal sellPrice;

    @ApiModelProperty("商品进价")
    private BigDecimal buyPrice;

    @ApiModelProperty("分类id")
    private Long categoryId;

    @ApiModelProperty("品牌id")
    private Long brandId;

    @ApiModelProperty("规格id")
    private Long specificationId;

    @ApiModelProperty("单位id")
    private Long unitId;

    @ApiModelProperty("供应商id")
    private Long supplierId;

    @ApiModelProperty("毛利率（%）")
    private BigDecimal grossMargin;

    @ApiModelProperty("生产厂家名称")
    private String manufacturerName;

    @ApiModelProperty("生产时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date manufacturerTime;

    @ApiModelProperty("到期时间")
    private String expireTime;

    @ApiModelProperty("平台上架  1：上架 0：下架")
    private Boolean shelfFlag;

    @ApiModelProperty("描述")
    private String description;

    @ApiModelProperty("备注")
    private String remark;

}
